﻿<html DIR="LTR" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
  <head>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8" />
    <META NAME="save" CONTENT="history" />
    <title>getProcedures Method (SQLServerDatabaseMetaData)</title>
    
    <link rel="stylesheet" type="text/css" href="../local/Classic.css">
      
    </link>
    
    <script src="../local/script.js">
      
    </script><script src="../local/script_main.js">&amp;nbsp;</script>
  </head>
  <body>
    <!--Topic built:12/06/2007 20:50:20-->

    
    
    
    
    
    
    
    
    
    <div id="header">
      <table width="100%" id="topTable"><tr>
          <td align="left">
            <span id="headerBold">getProcedures Method (SQLServerDatabaseMetaData)</span>
          </td>
          <td align="right">
            
          </td>
        </tr></table>
      
      
      
    </div>
    <div id="mainSection">
      
        
        
		<font color="DarkGray"><!-- [This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]<br/>[Documentation built on $$TIMESTAMP$$]  --> </font> <p /> <p />
	
        <div id="introductionSection" class="section">
    <p>Retrieves a description of the stored procedures that are available in the given catalog, schema, or stored procedure name pattern.</p>
  </div><h1 class="heading">语法</h1><div id="syntaxSection" class="section"><div class="sampleCode"><span codeLanguage="other"><pre>
public java.sql.ResultSet <b>getProcedures</b>(java.lang.String <i>sCatalog</i>,
                                        java.lang.String <i>sSchema</i>,
                                        java.lang.String <i>proc</i>)</pre></span></div><h1 class="heading">参数</h1><div id="parametersSection" class="section" name="collapseableSection">
    <content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
      <p xmlns="">
        <i>sCatalog</i>
      </p>
      <p xmlns="">A<b> String </b>that contains the catalog name. Providing a null to this parameter indicates that the catalog name does not need to be used.</p>
      <p xmlns="">
        <i>sSchema</i>
      </p>
      <p xmlns="">A<b> String </b>that contains the schema name pattern. Providing a null to this parameter indicates that the schema name does not need to be used.</p>
      <p xmlns="">
        <i>proc</i>
      </p>
      <p xmlns="">A<b> String </b>that contains the procedure name pattern.</p>
    </content>
  </div></div><h1 class="heading">返回值</h1><div id="returnValueSection" class="section" name="collapseableSection">
    <content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
      <p xmlns="">A <a href="eaffcff1-286c-459f-83da-3150778480c9.htm">SQLServerResultSet</a> object.</p>
    </content>
  </div><h1 class="heading">异常</h1><div id="exceptionsSection" class="section" name="collapseableSection">
    <content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
      <p xmlns="">
        <a href="af5ef257-7cf6-4db3-b1ee-07d22d82bef1.htm">SQLServerException</a>
      </p>
    </content>
  </div><h1 class="heading">备注</h1><div id="remarksSection" class="section" name="collapseableSection">
    <content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
      <p xmlns="">This <b>getProcedures</b> method is specified by the <b>getProcedures</b> method in the java.sql.DatabaseMetaData interface.</p>
      <p xmlns="">The result set returned by the <b>getProcedures</b> method will contain the following information:</p>
      <table width="100%" cellspacing="0" cellpadding="0" border="1" style="background-color: #CCCCCC;" xmlns=""><tr>
            <th>
              Name
            </th>
            <th>
              Type
            </th>
            <th>
              Description
            </th>
          </tr><tr>
          <td>
            <p>PROCEDURE_CAT</p>
          </td>
          <td>
            <p>
              <b>String</b>
            </p>
          </td>
          <td>
            <p>The name of the database in which the specified stored procedure resides.</p>
          </td>
        </tr><tr>
          <td>
            <p>PROCEDURE_SCHEM</p>
          </td>
          <td>
            <p>
              <b>String</b>
            </p>
          </td>
          <td>
            <p>The schema for the stored procedure.</p>
          </td>
        </tr><tr>
          <td>
            <p>PROCEDURE_NAME</p>
          </td>
          <td>
            <p>
              <b>String</b>
            </p>
          </td>
          <td>
            <p>The name of the stored procedure.</p>
          </td>
        </tr><tr>
          <td>
            <p>NUM_INPUT_PARAMS</p>
          </td>
          <td>
            <p>
              <b>int</b>
            </p>
          </td>
          <td>
            <p>Reserved for future use, currently returns a -1 value.</p>
          </td>
        </tr><tr>
          <td>
            <p>NUM_OUTPUT_PARAMS</p>
          </td>
          <td>
            <p>
              <b>int</b>
            </p>
          </td>
          <td>
            <p>Reserved for future use, currently returns a -1 value.</p>
          </td>
        </tr><tr>
          <td>
            <p>NUM_RESULT_SETS</p>
          </td>
          <td>
            <p>
              <b>int</b>
            </p>
          </td>
          <td>
            <p>Reserved for future use, currently returns a -1 value.</p>
          </td>
        </tr><tr>
          <td>
            <p>REMARKS</p>
          </td>
          <td>
            <p>
              <b>String</b>
            </p>
          </td>
          <td>
            <p>The description of the procedure column.</p>
            <div style="margin: .5em 1.5em .5em 1.5em"><b>注意：</b>
              SQL Server does not return a value for this column.<p />
            </div>
          </td>
        </tr><tr>
          <td>
            <p>PROCEDURE_TYPE</p>
          </td>
          <td>
            <p>
              <b>short</b>
            </p>
          </td>
          <td>
            <p>The type of stored procedure. It can be one of the following values:</p>
            <p>procedureResultUnknown (0)</p>
            <p>procedureNoResult (1)</p>
            <p>procedureReturnsResult (2)</p>
          </td>
        </tr></table>
      <div style="margin: .5em 1.5em .5em 1.5em" xmlns=""><b>注意：</b>
        For more information about the data returned by the <b>getProcedures</b> method, see "sp_stored_procedures (Transact-SQL)" in SQL Server Books Online.<p />
      </div>
    </content>
  </div><h1 class="heading">示例</h1><div id="codeExampleSection" class="section" name="collapseableSection">
    <description xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
      <content>
        <p xmlns="">The following example demonstrates how to use the <b>getProcedures</b> method to return information about the uspGetBillOfMaterials stored procedure in the SQL Server 2005 AdventureWorks sample database.</p>
      </content>
    </description>
    <div class="sampleCode"><span codeLanguage="other"><pre>public static void executeGetProcedures(Connection con) {
   try {
      DatabaseMetaData dbmd = con.getMetaData();
      ResultSet rs = dbmd.getProcedures(null, null, "uspGetBillOfMaterials");
      ResultSetMetaData rsmd = rs.getMetaData();

      // Display the result set data.
      int cols = rsmd.getColumnCount();
      while(rs.next()) {
         for (int i = 1; i &lt;= cols; i++) {
            System.out.println(rs.getString(i));
         }
      }
      rs.close();
   } 

   catch (Exception e) {
      e.printStackTrace();
   }
}</pre></span></div>
  </div><span id="seeAlsoSpan"><h1 class="heading">另请参见</h1></span><div id="seeAlsoSection" class="section" name="collapseableSection"><a href="8b8049d0-8c6d-4476-866b-098709f37eec.htm">SQLServerDatabaseMetaData Class</a><br /><a href="772de447-c922-4b85-8e10-5f0d9277966c.htm">SQLServerDatabaseMetaData Methods</a><br /><a href="327ba0bc-438a-494c-b119-1cd4a096bb58.htm">SQLServerDatabaseMetaData Members</a><br /><br />
		
		<b>
			
			
		</b>
	</div><!--[if gte IE 5]>
			<tool:tip element="seeAlsoToolTip" avoidmouse="false"/><tool:tip element="languageFilterToolTip" avoidmouse="false"/><tool:tip element="roleInfoSpan" avoidmouse="false"/>
		<![endif]-->
      <div id="footer" class="section">
        
		<hr />  <span id="fb" class="feedbackcss"> </span> 
		<a href="9bad553b-9e70-4696-8499-2e35f772a1e0.htm">
			
			© 2007 Microsoft Corporation。保留所有权利。
		</a>
 	
	
      </div>
    </div>
  </body>
</html>